package com.jwsoft.manager.core.dao.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 *
 *
 * @author zhiyuan
 * @since 2024-01-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("edu_address_tree_original")
@Schema(name = "EduAddressTreeOriginal", title = "", description = "实体类")
public class EduAddressTreeOriginal extends Model<EduAddressTreeOriginal> {

    private static final long serialVersionUID = 1L;

    @Schema(name = "addressId", description = "地址id")
    @TableId(value = "address_id", type = IdType.INPUT)
    private Long addressId;

    @Schema(name = "areaCode", description = "行政区划编码")
    @TableField(value = "area_code")
    private String areaCode;

    @Schema(name = "areaName", description = "组织名称")
    @TableField(value = "area_name")
    private String areaName;

    @Schema(name = "areaType", description = "行政区划类型 ")
    @TableField(value = "area_type")
    private String areaType;

    @Schema(name = "contact", description = "联系人")
    @TableField(value = "contact")
    private String contact;

    @Schema(name = "cellphone", description = "联系人手机")
    @TableField(value = "cellphone")
    private String cellphone;

    @Schema(name = "phone", description = "联系人电话")
    @TableField(value = "phone")
    private String phone;

    @Schema(name = "rate", description = "级别")
    @TableField(value = "rate")
    private Integer rate;

    @Schema(name = "orderNo", description = "排序号")
    @TableField(value = "order_no")
    private Integer orderNo;

    @Schema(name = "primarySchool", description = "小学默认学校组织id")
    @TableField(value = "primary_school")
    private String primarySchool;

    @Schema(name = "middleSchool", description = "中学默认学校组织id")
    @TableField(value = "middle_school")
    private String middleSchool;

    @Schema(name = "parentId", description = "上级地址/区域")
    @TableField(value = "parent_id")
    private Long parentId;

    @Schema(name = "searchTerm", description = "检索项，使用#分割")
    @TableField(value = "search_term")
    private String searchTerm;

    @Schema(name = "isLeafNode", description = "是否叶子节点")
    @TableField(value = "is_leaf_node")
    private Integer isLeafNode;

    @Schema(name = "fullAddress", description = "完整地址信息")
    @TableField(value = "full_address")
    private String fullAddress;

    @Schema(name = "majorPointer", description = "映射记录指针，对应映射记录主键address_id")
    @TableField(value = "major_pointer")
    private Long majorPointer;

    @Schema(name = "isLastNode", description = "是否最后非叶子节点-es数据检索节点")
    @TableField(value = "is_last_node")
    private Integer isLastNode;

    @Schema(name = "eduAddressId", description = "edu_address主键")
    @TableField(value = "edu_address_id")
    private String eduAddressId;

    @Override
    public Serializable pkVal() {
        return this.addressId;
    }
}
